/*
 * @Author: mikey.zhaopeng 
 * @Date: 2018-12-19 23:07:50 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2018-12-19 23:14:54
 */
import 'package:flutter/material.dart';

class SliderIndicator extends StatelessWidget {
  final int count;
  final int index;
  SliderIndicator({Key key, this.count, this.index}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children:dots,
    );
  }


  List<Widget> get dots{
    return List.generate(count, (i){
      final double size=i ==index?12.0:10.0;
      return Container(
        margin: const EdgeInsets.symmetric(horizontal: 4.0),
        width: size,
        height: size,
        decoration: BoxDecoration(
          border: Border.all(color: Colors.white,width: 2.0),
          shape: BoxShape.circle,
          color: i ==index ?Colors.white:null
        ),
      );
    });
  }
}
